(function() {
    'use strict';

    /**
     * @ngdoc function
     * @name webApp.controller:MainCtrl
     * @description
     * # MainCtrl
     * Controller of the webApp
     */
    angular.module('webApp')
        .controller('MainCtrl', MainCtrl);

    MainCtrl.$inject = ['$scope', 'dataService', 'helper', '$timeout', '$state', '$rootScope', 'sessionService'];

    function MainCtrl($scope, dataService, helper, $timeout, $state, $rootScope, sessionService) {
        $scope.indexAction = function() {
            $scope.LoadHOme();

            $scope.ary = {};
            //管理员不显示
            $rootScope.$on('event:up-store-id', function() {
                $scope.LoadHOme();
            });
        }

        //加载首页数据
        $scope.LoadHOme = function() {
            var user = sessionService.get("tokenUser");
            if (user && user.Role == 4) {

            } else {

                $state.go("home.index");
            }
        }


    }
})();